package top.tagao.m02_creationalPatterns.c_01_builder;

import com.sun.xml.internal.ws.api.pipe.Engine;
import top.tagao.m02_creationalPatterns.c_01_builder.builders.Builder;

/**
 * 指挥者（Director）
 * @author fu-xiao-liu
 * @Date 2022/7/24 14:45
 */
public class Director {
    public void constructSportsCar(Builder builder) {
        builder.setCarType("CarType.SPORTS_CAR");
        builder.setSeats(2);
        builder.setEngine("new Engine(3.0, 0)");
        builder.setTransmission("Transmission.SEMI_AUTOMATIC");
        builder.setTripComputer("new TripComputer()");
        builder.setGPSNavigator("new GPSNavigator()");
    }

    public void constructCityCar(Builder builder) {
        builder.setCarType("CarType.CITY_CAR");
        builder.setSeats(2);
        builder.setEngine("new Engine(1.2, 0)");
        builder.setTransmission("Transmission.AUTOMATIC");
        builder.setTripComputer("new TripComputer()");
        builder.setGPSNavigator("new GPSNavigator()");
    }

}
